<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK IT ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006-2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: yunwuxin <448901948@qq.com>
// +----------------------------------------------------------------------
/**
 * https://github.com/top-think/think-queue
 */
return [
    'default' => 'rabbitmq',
    'connections' => [
        'sync' => [
            'type' => 'sync',
        ],
        'database' => [
            'type' => 'database',
            'queue' => 'default',
            'table' => 'jobs',
            'connection' => null,
        ],
        'redis' => [
            'type' => 'redis',
            'queue' => 'default',
            'host' => '127.0.0.1',
            'port' => 6379,
            'password' => '',
            'select' => 0,
            'timeout' => 0,
            'persistent' => false,
        ],
        'rabbitmq' => [
            'type'       => app\job\drive\rabbitmq\connector\RabbitMQ::class,
            'connection' => PhpAmqpLib\Connection\AMQPStreamConnection::class,
            'queue'      => 'default',
            'hosts' => [
                [
                    'host' => env('amqp.amqp_host', 'localhost'),
                    'port' => env('amqp.amqp_port', 5672),
                    'user' => env('amqp.amqp_user', 'guest'),
                    'password' => env('amqp.amqp_password', 'guest'),
                    'vhost' => env('amqp.amqp_vhost', '/'),
                    'queue' => env('amqp.amqp_queue', 'default'),
                    'exchange' => env('amqp.amqp_exchange', 'amq.direct'),
                    'routing_key' => env('amqp.amqp_routing_key', 'default'),
                ],
            ],
            'options' => [
                'ssl_options' => [
                    'cafile'      => null,
                    'local_cert'  => null,
                    'local_key'   => null,
                    'verify_peer' => null,
                    'passphrase'  => null,
                ],
                'queue' => [
                    'job' => app\job\drive\rabbitmq\job\RabbitMQ::class,
                ],
            ],
        ],
    ],
    'failed' => [
        'type' => 'none',
        'table' => 'failed_jobs',
    ],
];
